# import socket
#
# phone = socket.socket()
#
# phone.connect(('127.0.0.1',8848))
# while 1:
#     to_server_data = input('>>>输入q或者Q退出').strip().encode('utf-8')
#     if not to_server_data:
#         # 服务端如果接受到了空的内容，服务端就会一直阻塞中，所以无论哪一端发送内容时，都不能为空发送
#         print('发送内容不能为空')
#         continue
#     phone.send(to_server_data)
#     if to_server_data.upper() == b'Q':
#         break
#     from_server_data = phone.recv(300)  # 最多接受1024字节
#     # print(f'{from_server_data.decode("gbk")}')
#     print(len(from_server_data))
#
# phone.close()



# 2. 连续短暂的send多次(数据量很小),你的数据会统一发送出去.

# import socket
#
# phone = socket.socket()
#
# phone.connect(('127.0.0.1',8848))
#
#
# phone.send(b'he')
# phone.send(b'll')
# phone.send(b'o')
#
#
# phone.close()
# Nigle算法

